package com.myebills.ebpsfrontend.cust.controller;

import java.util.jar.Attributes;

/**
 * Concrete class that is attached to a EbppxFormDisplayServlet
 * to indicate which input fields contain invalid data.
 */
public class EbppxInputFieldMessages {

        /**
         * The attribute name used to store an instance of this class
         * in the request scope for access by Java Server Pages.
         */
        public static final String REQUEST_ATTRIBUTE_NAME = "EbppxInputFieldMessages";

        final java.util.jar.Attributes _attributes;

        /**
         * EbpxxInputFieldMessages constructor comment.
         */
        public EbppxInputFieldMessages() {
                super();
                _attributes = new java.util.jar.Attributes();
        }
        /**
         * Returns diagnostic message associated with field, or "" if there is none.
         */
        public String getFieldMessage(String sField)
        {
                final String s = _attributes.getValue(sField);
                return (null != s) ? s : "";
        }
        public int getInputFieldMessageCount() {
            return _attributes.size();
        }
        /**
         * Create diagnostic message associated with field.
         */
        public void setFieldMessage(String sField, String sMsg)
        {
                _attributes.putValue(sField, sMsg);
        }
}
